import StockList from '../Container/StockList'
import { Route, Link, Switch,Redirect } from 'react-router-dom'

import './MenuJs.css'
import { Layout, Menu, Icon } from 'antd';
import React, { Component } from 'react';
import Other from '../Container/Other';
const { Header, Sider, Content } = Layout;

class MenuJs extends React.Component {
  state = {
    collapsed: false,
  };

  toggle = () => {
    this.setState({
      collapsed: !this.state.collapsed,
    });
  }

  render() {
    return (
      <Layout style={{ height: "-webkit-fill-available" }}>
        <Sider
          trigger={null}
          collapsible
          collapsed={this.state.collapsed}
        >
          <div className="logo" />
          <Menu theme="dark" mode="inline" defaultSelectedKeys={['1']}>
            <Menu.Item key="1">
              <Link to="/MenuJs/StockList">
                <Icon type="user" />
                <span>gupiao列表</span>
              </Link>

            </Menu.Item>
            <Menu.Item key="2">
              <Link to="/MenuJs/other">
                <Icon type="user" />
                <span>2</span>
              </Link>
            </Menu.Item>
            <Menu.Item key="3">
              <Icon type="upload" />
              <span>nav 3</span>
            </Menu.Item>
          </Menu>
        </Sider>
        <Layout>
          <Header style={{ background: '#fff', padding: 0, textAlign: 'left' }}>
            <Icon
              className="trigger"
              type={this.state.collapsed ? 'menu-unfold' : 'menu-fold'}
              onClick={this.toggle}
            />
          </Header>
          <Content style={{
            margin: '24px 16px', padding: 24, background: '#fff', minHeight: 300,
          }}
          >
          
            <Route render={({ location }) => (
              <Switch>
                <div>
                <Route location={location} exact path='/MenuJs' render={() =>  <StockList />} />
                <Route location={location} path="/MenuJs/StockList" component={StockList} />
                <Route location={location} path="/MenuJs/other" component={Other} />
              </div>
              </Switch>
             
     
            )} />


          </Content>
        </Layout>

      </Layout>

    );
  }
}

export default MenuJs;


